import cn.yunhe.dao.IOrderDao;
import cn.yunhe.entity.Order;
import cn.yunhe.entity.OrderCon;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

/**
 * 李非凡
 * 订单展示测试
 */
public class OrderDemo {
    SqlSession sqlSession = null;
    IOrderDao iOrderDao = null;

    @Before
    public void init() {
        sqlSession = SqlSessionFactoryUtil.getSqlSession();
        iOrderDao = sqlSession.getMapper(IOrderDao.class);
    }

    @Test
    public void test1() {
        List<Order> orderList = iOrderDao.getOrder(1);
        for (Order o : orderList) {
            System.out.println(o.getOid()+","+o.getAddress()+","+o.getCreateDate()+",");
        }
    }

    @After
    public void des(){
        sqlSession.close();
    }
}
